#include<stdio.h>
#include<stdlib.h>
#define maxsize 100
typedef struct{
	int data[maxsize];
	int top;
}stack;
void initstack(stack *s)
{
	s->top=-1;
}
int isempty(stack *s)
{
	return s->top==-1;
}
void push(stack *s,int value)
{
	if(s->top<maxsize-1)
	{
		s->data[++(s->top)]=value;
	}
}
int pop(stack *s) 
{
    if (!isempty(s)) 
	{
        return s->data[(s->top)--];
    }
    return -1;
}
int isuglynum(int n) 
{
    if (n <= 0) 
	{
        return 0;
    }
    stack s;
    initstack(&s);
    push(&s, n);

    while (!isempty(&s)) 
	{
        int num = pop(&s);
        if (num % 2 == 0) 
		{
            push(&s, num / 2);
        } 
		else if (num % 3 == 0) 
		{
            push(&s, num / 3);
        } 
		else if (num % 5 == 0) 
		{
            push(&s, num / 5);
        } 
		else if (num != 1) 
		{
            return 0;
        }
    }
    return 1;
}

int main()
{
	int n;
	scanf("%d",&n);
		if (isuglynum(n)) 
		{
        printf("YES\n");
    	} 
		else 
		{
        	printf("NO\n");
    	}
	
	return 0;
}
